home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.10 / demo / sparx.i / .spark02.i next >
Text File  |  1995-04-19  |  985b  |  59 lines

  1.  
  2. Procedure Spark02;
  3. Const
  4.     max2lines = 48;
  5.  
  6. Type
  7.     Sp1lines    = Array[1..max2lines] of line;
  8.     Sp1LinesPtr = ^Sp1Lines;
  9.  
  10. Var
  11.     arr    : Sp1LinesPtr;
  12.     cnt1    : Short;
  13.     cnt2    : Short;
  14.     CCNT    : Short;
  15.     add1    : Short;
  16.     add2    : Short;
  17.     actualline : Short;
  18. Begin
  19.     New(arr);
  20.     ActualLine := 1;
  21.  
  22.  
  23.     cnt1 := 1;
  24.     cnt2 := 3;
  25.     CCNT := 2;
  26.     add1 := 7;
  27.     add2 := 4;
  28.  
  29.     Repeat
  30.       EraseLine( Adr(arr^[actualline]) );
  31.       With arr^[actualline] do begin
  32.         x1 := 160 + XSin^[cnt1]   * 7 DIV 5;    { +1 140 }
  33.         y1 := 120 + XCos^[cnt1+5];
  34.         x2 := 160 + XSin^[cnt2]   * 7 DIV 5;    { +- 140 }
  35.         y2 := 120 + XCos^[cnt2+5];
  36.       end;
  37.  
  38.       cnt1 := cnt1 + add1;
  39.       if cnt1>627 then cnt1:= cnt1-628;
  40.  
  41.       cnt2 := cnt2 + add2;
  42.       if cnt2>627 then cnt2:= cnt2-628;
  43.  
  44.       DrawLine( Adr(arr^[actualline]), cnt2 );
  45.  
  46.       inc( CCNT );
  47.       If CCNT > maxColors then CCNT := 2;
  48.  
  49.       inc( actualline );
  50.       If actualline > max2lines then actualline := 1;
  51.  
  52.     Until LeftMouseButton;
  53.  
  54.     Ciao;
  55.     Dispose(arr);
  56.     SetSColors( Adr(Def_Colors) );
  57. End;
  58.  
  59.